set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_VERSION 1)

set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
set(CMAKE_AR arm-none-eabi-ar)
set(CMAKE_OBJCOPY arm-none-eabi-objcopy)
set(CMAKE_OBJDUMP arm-none-eabi-objdump)
set(SIZE arm-none-eabi-size)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

add_compile_options(-mcpu=cortex-m7)
add_definitions(-DCPU_MIMXRT1064DVL6A -DSKIP_SYSCLK_INIT -DXIP_EXTERNAL_FLASH=1 -D XIP_BOOT_HEADER_DCD_ENABLE=1 -D XIP_BOOT_HEADER_ENABLE=1 -DPRINTF_FLOAT_ENABLE=1 -D SCANF_FLOAT_ENABLE=1 -D PRINTF_ADVANCED_ENABLE=1 -D SCANF_ADVANCED_ENABLE=1 -DFSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ=0 -DUSB_STACK_BM)
add_link_options(-Wl,-gc-sections,--print-memory-usage,-Map=${PROJECT_BINARY_DIR}/${PROJECT_NAME}.map)
add_link_options(-mcpu=cortex-m7 -mthumb -mthumb-interwork)
add_link_options(-mcpu=cortex-m7)
#add_link_options(-T ${LINKER_SCRIPT})


